<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/common/default.jsp"%>
<%@ page import="com.huixue.cn.ztej.enums.RoleStatus"%>
<%@ page import="com.huixue.cn.ztej.bean.User"%>
<%@ page import="com.huixue.cn.ztej.utils.Urls"%>

<%
	String reportUrl = Urls.BASE_REPORT_URL+"/birt/frameset?__report=emply_report.rptdesign";
	User user = (User)request.getSession().getAttribute("loginUser");

%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<style type="text/css">
		.advance_tip_pwd{
			background-color: #fff;
		    left: 42%;
		    position: fixed;
		    top: 200px;
		    width: 487px;
		    z-index: 5;
		}
		</style>
	
	</head>
	
	<body>
		<div class="cinema_tip">
		    <div class="cinema_subject clearfix">
		        <div class="cinema_title">
		            <a href="#">报表管理</a>
		            >
		            <a href="#" class="cinema_option">用工汇总表</a>
		        </div>
		    </div>
			<form  id="sysReportForm" method="get">
		       <div class="cinema_search clearfix" style="height: 800px">
					<div class="cinema_button">
				        	<input id="sysUserInfoSearch" type="button" value="查询" name="" style="float: none;" class="cinema_inquiry movie_no" onclick="searchReportForm()">
					</div>
					<div class="cinema_condition width_84">
						<div class="cinema_smart" style="float:none">
							<div class="cinema_inter">
							
							<label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 申请时间： </label>
							    <input style="display:inline" type="text" id="startTime" name="startTime" maxlength="50" placeholder="请选择开始时间" class="col-xs-10 col-sm-2" class="Wdate" onFocus="WdatePicker({lang:'zh-cn',readOnly:true})"/>
								-
								<input style="display:inline" type="text" id="endTime" name="endTime" maxlength="50" placeholder="请选择结束时间" class="col-xs-10 col-sm-2" onFocus="WdatePicker({lang:'zh-cn',readOnly:true})"/>
							</div>	
							<dt>
							<div class="cinema_inter" style="width:300px">
								<%
									if(user.getRoleId().equals(RoleStatus.ROLE_7.getRoleId()+"")||user.getRoleId().equals(RoleStatus.ROLE_SYSTETM.getRoleId()+"")||user.getRoleId().equals(RoleStatus.ROLE_9.getRoleId()+"")){
								%>
								<label class="col-sm-1 control-label no-padding-right" for="form-field-1" style="float:left;line-height:33px;padding-left:10px"> 项目名称： </label>
								<div style="float:left;margin-top: -15px">
								<select name="projectId" id="projectId" nowrap style="float:left">
										<option value="0">请选择项目名称</option>
										<c:forEach var="project" items="${project}">
											<option value="${project.proId}">${project.name}</option>
										</c:forEach>
								</select>
								</div>
								<%		
									}else{
								%>
								<input type="hidden" id="projectId" name="projectId" value="<%=user.getProjectID()%>"/>
								<%
									}
								%>
								</div>
						</dt>
								
							</div>
						</div>
					</div>
				</div>
			</form>
		</div>
		<script type="text/javascript" src="${ctx}/static/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript">
		function searchReportForm(){
			var proId = $("#projectId").val();
			var startDate = $("#startTime").val();
			var endDate = $("#endTime").val();
			var urls = "<%=reportUrl%>&pro_id="+proId;
			if(startDate==''){
				startDate='-1';
			}
			if(endDate==''){
				endDate='-1';
			}else {
				endDate=endDate+" 23:59:59";
			}
			urls = urls+"&startDate="+startDate;
			urls = urls+"&endDate="+endDate;
			//window.location.href="http://www.baidu.com";
			window.parent.location.target="_blank";
			javascript:window.open(urls,"_blank")
		}
		</script>
	</body>
	
</html>
